package com.wst.system.server.service;

import com.wst.system.server.entity.SysFile;
import com.wst.system.server.entity.vo.SysFileVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wst.system.config.exception.GlobalExcetion;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wst.system.server.entity.vo.PageSearchVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 * 文件表 服务类
 * </p>
 *
 * @author X.I.O
 * @since 2025-02-27
 */
public interface SysFileService extends IService<SysFile> {

    public SysFile saveSysFile(SysFile sysfile) throws GlobalExcetion;

    public SysFile updateSysFileById(SysFile sysfile) throws GlobalExcetion;

    public SysFile saveOrUpdateSysFile(SysFileVo sysfileVo) throws GlobalExcetion;

    public IPage<SysFile> page(PageSearchVo vo) throws GlobalExcetion;

    public SysFile uploadFile(MultipartFile file) throws Exception;

    public SysFile uploadFile(MultipartFile file,String groupId) throws Exception;

    public SysFile uploadFile(MultipartFile file,String groupId,String tableName,String tableField,String bindId) throws Exception;

    public SysFile getSysFileByMd5andSha256(String md5,String sha256) throws GlobalExcetion;

    public String getSysFileUrl(SysFile sysFile,Long expireTime) throws GlobalExcetion;

    public int updateBatchPermession(List<String> ids,String permession,String uid) throws GlobalExcetion;

    public int removeBySha256Md5(String sha256,String md5) throws GlobalExcetion;
}